;;; This file is part of guix-bavier.git
;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
;;; License: GPLv3+

(define-module (bavier packages c)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages tcl)
  #:use-module ((guix licenses) #:prefix license:))

(define-public bic
  (let ((commit "0dbe9fff02dad2574c34c3255a87b642bf9036df")
        (revision "0"))
    (package
     (name "bic")
     (version "0.9.1")
     (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/hexagonal-sun/bic.git")
                    (commit (string-append "v" version))))
              (sha256
               (base32
                "1625b1apiyh56m4771qyvgr39jwr8ykf9k3qy657b3jgcb88bxhm"))
              (modules '((guix build utils)))
              (snippet
               ;; See https://github.com/hexagonal-sun/bic/issues/23
               '(begin (substitute* "testsuite/test.sh"
                         (("-!") "!"))))))
     (build-system gnu-build-system)
     (native-inputs
      `(("autoconf" ,autoconf)
        ("autoconf-archive" ,autoconf-archive)
        ("automake" ,automake)
        ("bison" ,bison)
        ("expect" ,expect)              ; For tests
        ("flex" ,flex)))            
     (inputs
      `(("gmp" ,gmp)
        ("readline" ,readline)))
     (home-page "https://github.com/hexagonal-sun/bic")
     (synopsis "C interpreter and API explorer")
     (description "BIC allows developers to explore and test C-APIs using a
read eval print loop, also known as a REPL.")
     (license license:gpl2+))))
